package com.company.app.service;

import java.util.List;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.xml.ws.WebServiceException;

import com.company.app.entities.ProductType;

/**
 * The Interface ProductTypeService.
 */
@Path("/ProductTypeService")
@WebService()
public interface ProductTypeService {
	
	/**
	 * Gets the all product types.
	 *
	 * @return the all product types
	 */
	@GET
	@Produces({"application/json", "application/xml"})
	@Path("/getAllProductTypes")
	@WebMethod(operationName="getAllProductTypes")
	public List<ProductType> getAllProductTypes();
	
	/**
	 * Search product type by filter.
	 *
	 * @param producTypeFilter the produc type filter
	 * @return the list
	 */
	@GET
	@Produces({"application/json", "application/xml"})	
	@Path("/searchProductTypeByFilter")
	@Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
	@WebMethod(operationName="searchProductTypeByFilter")
	public List<ProductType> searchProductTypeByFilter(@WebParam(name="ProductFilter") @QueryParam("") ProductType producTypeFilter) throws WebServiceException;
	
	/**
	 * Gets the product type by id.
	 *
	 * @param id the id
	 * @return the product type by id
	 */
	@GET
	@Produces({"application/json", "application/xml"})
	@Path("/{id}")
	@WebMethod(operationName="getProductTypeById")	
	public @WebResult(name="ProductType", targetNamespace="http://entities.app.company.com") ProductType getProductTypeById(@WebParam(name="id") @PathParam ("id") Long id) throws WebServiceException;
	
	/**
	 * Creates the product type.
	 *
	 * @param productType the product type
	 * @return true, if successful
	 */
	@POST
	@Produces("text/plain")	
	@Path("/createProductType")
	@WebMethod(operationName="createProductType")
	public @WebResult(name="success") boolean createProductType(@WebParam(name="ProductEntity") @QueryParam("") ProductType productType) throws WebServiceException;
	
	/**
	 * Update product type.
	 *
	 * @param productType the product type
	 * @return true, if successful
	 */
	@PUT
	@Produces("text/plain")	
	@Path("/updateProductType")
	@WebMethod(operationName="updateProductType")
	public @WebResult(name="success") boolean updateProductType(@WebParam(name="UpdateEntity") @QueryParam("") ProductType productType) throws WebServiceException;
	
	/**
	 * Delete product.
	 *
	 * @param productType the product type
	 * @return true, if successful
	 */
	@DELETE
	@Produces("text/plain")	
	@Path("/deleteProductType")
	@WebMethod(operationName="deleteProductType")
	public @WebResult(name="success") boolean deleteProduct(@WebParam(name="DeleteEntity") @QueryParam("") ProductType productType) throws WebServiceException;
	
	@POST
	@Produces({"application/json", "application/xml"})	
	@Path("/createTmpObject")
	@WebMethod(operationName="createTmpObject")
	public @WebResult(name="ProductType") ProductType createTmpProduct() throws WebServiceException;

}
